﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03_DecimalToHexadecimal
{
    class Program
    {


        static void Main(string[] args)
        {
            int normalNumber =int.Parse(Console.ReadLine());
            StringBuilder convertedNumber = new StringBuilder();
            while (normalNumber > 0)
            {
                switch (normalNumber % 16)
                {
                    case 10:
                        convertedNumber.Append('A');
                        break;
                    case 11:
                        convertedNumber.Append('B');
                        break;
                    case 12:
                        convertedNumber.Append('C');
                        break;
                    case 13:
                        convertedNumber.Append('D');
                        break;
                    case 14:
                        convertedNumber.Append('E');
                        break;
                    case 15:
                        convertedNumber.Append('F');
                        break;                    

                    default:
                        convertedNumber.Append(normalNumber % 16);
                        break;
                }
                normalNumber /= 16;
            }
            Console.WriteLine();

            for (int index = 0; index < convertedNumber.Length / 2; index++)
			{
                char swapValue = convertedNumber[index];
                convertedNumber[index] = convertedNumber[convertedNumber.Length - index - 1];
                convertedNumber[convertedNumber.Length - index - 1] = swapValue;
			}

            Console.WriteLine(convertedNumber);
        }
    }
}
